from django.db.models.signals import post_save
from rankings.models import Ranking
from django.contrib.sites.models import Site

def update_site(sender, **kwargs):
    ranking = kwargs['instance']
    ranking.site.save()
    Site.objects.update()
    Ranking.objects.update()



def init_signals():
    post_save.connect(update_site, sender=Ranking)